﻿using System;
using System.ComponentModel;


namespace BestCode.Creds.Entities
{
    public class DUA_Persona : EntityId
    {
        public virtual string CodRegion { get; set; }
        public virtual string Guid { get; set; }
        public virtual int Id { get; set; }
        public virtual string Lenguaje { get; set; }

        public DUA_Persona()
        {
            Guid = System.Guid.NewGuid().ToString();
        }

    }


    public class FieldDefinition : DUA_Persona
    {
        private string code;
        private string firstName;
        private string secondName;
        private string lastName1;
        private string lastName2;
        private string bloodType;
        private string medicalReport;

        private string address;
        private string addressZone;
        private string especiality;
        private string workPhone;
        private string cellPhone;
        private string contactPersonName;
        private string picture;
        private string barCodeString;
        private string email;


        private string gender;
        private DateTime? dateOfBirth;

        private EntityInfo entity;
        private EntityChild entityChild;
        private bool isEnabled;

        private string cI;

        public virtual string Code
        {
            get { return code; }
            set
            {
                code = value;
                this.FirePropertyChanged("Code");
            }
        }

        public virtual string FirstName
        {
            get { return firstName; }
            set
            {
                firstName = value;
                this.FirePropertyChanged("FirstName");
            }
        }

        public virtual string SecondName
        {
            get { return secondName; }
            set
            {
                secondName = value;
                this.FirePropertyChanged("SecondName");
            }
        }

        public virtual string LastName1
        {
            get { return lastName1; }
            set
            {
                lastName1 = value;
                this.FirePropertyChanged("LastName1");
            }
        }

        public virtual string LastName2
        {
            get { return lastName2; }
            set
            {
                lastName2 = value;
                this.FirePropertyChanged("LastName2");
            }
        }

        public virtual string BloodType
        {
            get { return bloodType; }
            set
            {
                bloodType = value;
                this.FirePropertyChanged("BloodType");
            }
        }

        public virtual string MedicalReport
        {
            get { return medicalReport; }
            set
            {
                medicalReport = value;
                this.FirePropertyChanged("MedicalReport");
            }
        }

        public virtual string Address
        {
            get { return address; }
            set
            {
                address = value;
                this.FirePropertyChanged("Address");
            }
        }

        public virtual string AddressZone
        {
            get { return addressZone; }
            set
            {
                addressZone = value;
                this.FirePropertyChanged("AddressZone");
            }
        }

        public virtual string Especiality
        {
            get { return especiality; }
            set
            {
                especiality = value;
                this.FirePropertyChanged("Especiality");
            }
        }

        public virtual string WorkPhone
        {
            get { return workPhone; }
            set
            {
                workPhone = value;
                this.FirePropertyChanged("WorkPhone");
            }
        }

        public virtual string CellPhone
        {
            get { return cellPhone; }
            set
            {
                cellPhone = value;
                this.FirePropertyChanged("CellPhone");
            }
        }

        public virtual string ContactPersonName
        {
            get { return contactPersonName; }
            set
            {
                contactPersonName = value;
                this.FirePropertyChanged("ContactPersonName");
            }
        }

        public virtual string Picture
        {
            get { return picture; }
            set
            {
                picture = value;
                this.FirePropertyChanged("Picture");
            }
        }

        public virtual string BarCodeString
        {
            get { return barCodeString; }
            set
            {
                barCodeString = value;
                this.FirePropertyChanged("BarCodeString");
            }
        }

        public virtual EntityInfo Entity
        {
            get { return entity; }
            set
            {
                entity = value;
                this.FirePropertyChanged("Entity");
            }
        }

        public virtual EntityChild EntityChild
        {
            get { return entityChild; }
            set
            {
                entityChild = value;
                this.FirePropertyChanged("EntityChild");
            }
        }


        public virtual string Gender
        {
            get { return gender; }
            set
            {
                gender = value;
                this.FirePropertyChanged("Gender");
            }
        }

        public virtual DateTime? DateOfBirth
        {
            get { return dateOfBirth; }
            set
            {
                dateOfBirth = value;
                this.FirePropertyChanged("DateOfBirth");
            }
        }

        public virtual bool IsEnabled
        {
            get { return isEnabled; }
            set
            {
                isEnabled = value;
                this.FirePropertyChanged("IsEnabled");
            }
        }

        public virtual string CI
        {
            get { return cI; }
            set
            {
                cI = value;
                this.FirePropertyChanged("CI");
            }
        }

        public virtual string Email
        {
            get { return email; }
            set
            {
                email = value;
                this.FirePropertyChanged("Email");
            }
        }



        //not persist
        public virtual string FullName
        {
            get
            {
                return
                    (!string.IsNullOrEmpty(LastName1) ? LastName1 : string.Empty) + " " +
                    (!string.IsNullOrEmpty(LastName2) ? LastName2 : string.Empty) + " " +
                    (!string.IsNullOrEmpty(FirstName) ? FirstName : string.Empty) + " " +
                    (!string.IsNullOrEmpty(SecondName) ? SecondName : string.Empty);
            }
        }

        //not persist
        public virtual string FirstCompositeName
        {
            get
            {
                return
                    (!string.IsNullOrEmpty(FirstName) ? FirstName : string.Empty) + " " +
                    (!string.IsNullOrEmpty(SecondName) ? SecondName : string.Empty);
            }
        }

        //not persist
        public virtual string LastCompositeName
        {
            get
            {
                return
                    (!string.IsNullOrEmpty(LastName1) ? LastName1 : string.Empty) + " " +
                    (!string.IsNullOrEmpty(LastName2) ? LastName2 : string.Empty);
            }
        }

    }
}
